<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
	<Script file="Minimap.lua"/>
	<Frame name="MinimapCluster" frameStrata="BACKGROUND" enableMouse="true" parent="UIParent">
		<Size>
			<AbsDimension x="192" y="192"/>
		</Size>
		<Anchors>
			<Anchor point="TOPRIGHT"/>
		</Anchors>
		<HitRectInsets>
			<AbsInset left="30" right="10" top="0" bottom="30"/>
		</HitRectInsets>
		<Layers>
			<Layer level="ARTWORK">
				<Texture name="MinimapBorderTop" file="Interface\Minimap\UI-Minimap-Border">
					<Size>
						<AbsDimension x="192" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="TOPRIGHT"/>
					</Anchors>
					<TexCoords left="0.25" right="1.0" top="0.0" bottom="0.125"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button name="MinimapZoneTextButton">
				<Size>
					<AbsDimension x="128" y="12"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER">
						<Offset>
							<AbsDimension x="-3" y="83"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString name="MinimapZoneText" inherits="GameFontNormal" nonspacewrap="true">
							<Size>
								<AbsDimension x="128" y="12"/>
							</Size>
							<Anchors>
								<Anchor point="TOP"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnEnter>
						GameTooltip:SetOwner(this, "ANCHOR_LEFT");
						GameTooltip:AddLine(GetMinimapZoneText(), "", 1.0, 1.0, 1.0);
						local pvpType, factionName, isArena = GetZonePVPInfo();
						if ( (pvpType == "friendly") or (pvpType == "hostile") ) then
							GameTooltip:AddLine(format(FACTION_CONTROLLED_TERRITORY, factionName), "", 1.0, 1.0, 1.0);
						elseif ( pvpType == "contested" ) then
							GameTooltip:AddLine(CONTESTED_TERRITORY, "", 1.0, 1.0, 1.0);
						end
						if ( isArena ) then
							GameTooltip:AddLine(FREE_FOR_ALL_TERRITORY, "", 1.0, 1.0, 1.0);
						end
						GameTooltip:Show();
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Button>
			<Button name="MinimapToggleButton">
				<Size>
					<AbsDimension x="32" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-15" y="-13"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ToggleMinimap();
					</OnClick>
					<OnEnter>
						GameTooltip_AddNewbieTip(MINIMAP_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_MINIMAPTOGGLE, 1);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
				<NormalTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/>
				<PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/>
				<HighlightTexture alphaMode="ADD" file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight"/>
			</Button>
			<Minimap name="Minimap" enableMouse="true" minimapPlayerModel="Interface\Minimap\MinimapArrow.mdx" minimapArrowModel="Interface\Minimap\Rotating-MinimapArrow.mdl">
				<Size>
					<AbsDimension x="140" y="140"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER" relativePoint="TOP">
						<Offset>
							<AbsDimension x="9" y="-92"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Frames>
					<Frame name="MiniMapTrackingFrame" enableMouse="true" hidden="true">
						<Size>
							<AbsDimension x="33" y="33"/>
						</Size>
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset>
									<AbsDimension x="-15" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture name="MiniMapTrackingIcon">
									<Size>
										<AbsDimension x="26" y="26"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT">
											<Offset>
												<AbsDimension x="7" y="-6"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="OVERLAY">
								<Texture name="MiniMapTrackingBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
									<Size>
										<AbsDimension x="64" y="64"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								this:RegisterEvent("PLAYER_AURAS_CHANGED");
							</OnLoad>
							<OnEvent>
								if ( event == "PLAYER_AURAS_CHANGED" ) then
									local icon = GetTrackingTexture();
									if ( icon ) then
										MiniMapTrackingIcon:SetTexture(icon);
										MiniMapTrackingFrame:Show();
									else
										MiniMapTrackingFrame:Hide();
									end
								end
							</OnEvent>
							<OnMouseUp>
								if ( arg1 == "RightButton" ) then
									CancelTrackingBuff();			
								end
							</OnMouseUp> 
							<OnEnter>
								GameTooltip:SetOwner(this, "ANCHOR_BOTTOMLEFT");
								GameTooltip:SetTrackingSpell();
							</OnEnter>							
							<OnLeave>
								GameTooltip:Hide();
							</OnLeave>
						</Scripts>
					</Frame>
					<Button name="MiniMapMeetingStoneFrame" enableMouse="true" hidden="true">
						<Size>
							<AbsDimension x="33" y="33"/>
						</Size>
						<Anchors>
							<Anchor point="TOPRIGHT">
								<Offset>
									<AbsDimension x="23" y="-65"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture name="MiniMapMeetingStoneIcon" file="Interface\Icons\INV_Misc_Rune_06">								
									<Size>
										<AbsDimension x="18" y="18"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT">
											<Offset>
												<AbsDimension x="7" y="-6"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="OVERLAY">
								<Texture name="MiniMapMeetingStoneBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
									<Size>
										<AbsDimension x="52" y="52"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								this:RegisterEvent("MEETINGSTONE_CHANGED");
								this:SetFrameLevel(this:GetFrameLevel()+1)
							</OnLoad>
							<OnClick>
								StaticPopup_Show("CONFIRM_LEAVE_QUEUE");
							</OnClick>
							<OnEvent>
								if ( event == "MEETINGSTONE_CHANGED" ) then
									if ( IsInMeetingStoneQueue() ) then
										MiniMapMeetingStoneFrame:Show();
									else
										MiniMapMeetingStoneFrame:Hide();
									end
								end
							</OnEvent>
							<OnEnter>
								GameTooltip:SetOwner(this, "ANCHOR_BOTTOMLEFT");
								GameTooltip:SetText(GetMeetingStoneStatusText());								
							</OnEnter>							
							<OnLeave>
								GameTooltip:Hide();
							</OnLeave>
						</Scripts>						
						<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
					</Button>					
					<Frame name="MiniMapMailFrame" enableMouse="true" hidden="true">
						<Size>
							<AbsDimension x="33" y="33"/>
						</Size>
						<Anchors>
							<Anchor point="TOPRIGHT">
								<Offset>
									<AbsDimension x="21" y="-38"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture name="MiniMapMailIcon" file="Interface\Icons\INV_Letter_15">
									<Size>
										<AbsDimension x="18" y="18"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT">
											<Offset>
												<AbsDimension x="7" y="-6"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="OVERLAY">
								<Texture name="MiniMapMailBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
									<Size>
										<AbsDimension x="52" y="52"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								this:RegisterEvent("UPDATE_PENDING_MAIL");
								this:SetFrameLevel(this:GetFrameLevel()+1)
							</OnLoad>
							<OnEvent>
								if ( event == "UPDATE_PENDING_MAIL" ) then
									if ( HasNewMail() ) then
										this:Show();
									else
										this:Hide();
									end
								end
							</OnEvent>
							<OnEnter>
								GameTooltip:SetOwner(this, "ANCHOR_BOTTOMLEFT");
								GameTooltip:SetText(HAVE_MAIL);
							</OnEnter>							
							<OnLeave>
								GameTooltip:Hide();
							</OnLeave>
						</Scripts>
					</Frame>
					<Button name="MiniMapBattlefieldFrame" hidden="true">
						<Size>
							<AbsDimension x="33" y="33"/>
						</Size>
						<Anchors>
							<Anchor point="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="13" y="-13"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture name="MiniMapBattlefieldIcon" file="Interface\BattlefieldFrame\UI-Battlefield-Icon">
									<Size>
										<AbsDimension x="32" y="32"/>
									</Size>
									<Anchors>
										<Anchor point="CENTER">
											<Offset>
												<AbsDimension x="-1" y="0"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="ARTWORK">
								<Texture name="MiniMapBattlefieldBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
									<Size>
										<AbsDimension x="52" y="52"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT"/>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="BORDER">
								<Texture name="BattlegroundShine" file="Interface\ComboFrame\ComboPoint" alphaMode="ADD">
									<Size>
										<AbsDimension x="32" y="32"/>
									</Size>
									<Anchors>
										<Anchor point="CENTER">
											<Offset>
												<AbsDimension x="3" y="3"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0.5625" right="1" top="0" bottom="1"/>
								</Texture>
							</Layer>
						</Layers>
						<Frames>
							<Frame name="MiniMapBattlefieldDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true">
								<Scripts>
									<OnLoad>
										MiniMapBattlefieldDropDown_OnLoad();
									</OnLoad>
								</Scripts>
							</Frame>
						</Frames>
						<Scripts>
							<OnLoad>
								this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
								this:SetFrameLevel(this:GetFrameLevel()+1);
								MiniMapBattlefieldFrame.timeInQueue = 0;
							</OnLoad>
							<OnEnter>
								GameTooltip:SetOwner(this, "ANCHOR_LEFT");
								GameTooltip:SetText(this.tooltip);
							</OnEnter>
							<OnUpdate>
								if ( GameTooltip:IsOwned(this) ) then
									BattlefieldFrame_UpdateStatus(1);
									GameTooltip:SetText(this.tooltip);
								end
							</OnUpdate>
							<OnLeave>
								GameTooltip:Hide();
							</OnLeave>
							<OnClick>
								-- Hide tooltip
								GameTooltip:Hide();
								if ( MiniMapBattlefieldFrame.status == "active") then
									if ( arg1 == "RightButton" ) then
										ToggleDropDownMenu(1, nil, MiniMapBattlefieldDropDown, "MiniMapBattlefieldFrame", 10, -5);
									elseif ( IsShiftKeyDown() ) then
										ToggleBattlefieldMinimap();
									else
										ToggleWorldStateScoreFrame();
									end
								elseif ( arg1 == "RightButton" ) then
									ToggleDropDownMenu(1, nil, MiniMapBattlefieldDropDown, "MiniMapBattlefieldFrame", 10, -5);
								end
							</OnClick>
						</Scripts>
					</Button>
					<Model name="MiniMapPing" file="Interface\MiniMap\Ping\MinimapPing.mdx" scale="0.4" hidden="true">
						<Size>
							<AbsDimension x="50" y="50"/>
						</Size>
						<Anchors>
							<Anchor point="CENTER" relativeTo="Minimap"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								Minimap_OnLoad();
							</OnLoad>
							<OnEvent>
								Minimap_OnEvent();
							</OnEvent>
							<OnUpdate>
								Minimap_OnUpdate(arg1);
							</OnUpdate>
						</Scripts>
					</Model>
					<Frame name="MinimapBackdrop">
						<Size>
							<AbsDimension x="192" y="192"/>
						</Size>
						<Anchors>
							<Anchor point="CENTER" relativeTo="MinimapCluster">
								<Offset>
									<AbsDimension x="0" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture name="MinimapBorder" file="Interface\Minimap\UI-Minimap-Border">
									<TexCoords left="0.25" right="1.0" top="0.125" bottom="0.875"/>
								</Texture>
							</Layer>
						</Layers>
						<Frames>
							<Button name="MinimapZoomIn">
								<Size>
									<AbsDimension x="32" y="32"/>
								</Size>
								<Anchors>
									<Anchor point="CENTER">
										<Offset>
											<AbsDimension x="77" y="-13"/>
										</Offset>
									</Anchor>
								</Anchors>
								<Scripts>
									<OnClick>
										Minimap_ZoomInClick();
									</OnClick>
									<OnEnter>
										if ( GetCVar("UberTooltips") == "1" ) then
											GameTooltip_SetDefaultAnchor(GameTooltip, UIParent);
											GameTooltip:SetText(ZOOM_IN);
										end
									</OnEnter>
									<OnLeave>
										GameTooltip:Hide();
									</OnLeave>
								</Scripts>
								<NormalTexture file="Interface\Minimap\UI-Minimap-ZoomInButton-Up"/>
								<PushedTexture file="Interface\Minimap\UI-Minimap-ZoomInButton-Down"/>
								<DisabledTexture file="Interface\Minimap\UI-Minimap-ZoomInButton-Disabled"/>
								<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
							</Button>
							<Button name="MinimapZoomOut">
								<Size>
									<AbsDimension x="32" y="32"/>
								</Size>
								<Anchors>
									<Anchor point="CENTER">
										<Offset>
											<AbsDimension x="51" y="-41"/>
										</Offset>
									</Anchor>
								</Anchors>
								<Scripts>
									<OnClick>
										Minimap_ZoomOutClick();
									</OnClick>
									<OnEnter>
										if ( GetCVar("UberTooltips") == "1" ) then
											GameTooltip_SetDefaultAnchor(GameTooltip, UIParent);
											GameTooltip:SetText(ZOOM_OUT);
										end
									</OnEnter>
									<OnLeave>
										GameTooltip:Hide();
									</OnLeave>
								</Scripts>
								<NormalTexture file="Interface\Minimap\UI-Minimap-ZoomOutButton-Up"/>
								<PushedTexture file="Interface\Minimap\UI-Minimap-ZoomOutButton-Down"/>
								<DisabledTexture file="Interface\Minimap\UI-Minimap-ZoomOutButton-Disabled"/>
								<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
							</Button>
						</Frames>
					</Frame>
				</Frames>
				<Scripts>
					<OnMouseUp>
						Minimap_OnClick();
					</OnMouseUp>
				</Scripts>
			</Minimap>
		</Frames>
		<Scripts>
			<OnLoad>
				Minimap.timer = 0;
				Minimap_Update();
				this:RegisterEvent("MINIMAP_ZONE_CHANGED");
			</OnLoad>
			<OnEvent>
				Minimap_Update();
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>
